//
//  MeetingForetellFromModel_Two.m
//  Gxj
//
//  Created by 刘伟 on 2017/10/30.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "MeetingForetellFromModel_Two.h"

NSString *const kMeetingForetellTwo_meetingid = @"meetingid";
NSString *const kMeetingForetellTwo_title = @"title";
NSString *const kMeetingForetellTwo_info = @"info";
NSString *const kMeetingForetellTwo_industryid = @"industryid";
NSString *const kMeetingForetellTwo_userid = @"userid";
NSString *const kMeetingForetellTwo_create_date = @"create_date";
NSString *const kMeetingForetellTwo_start_date = @"start_date";
NSString *const kMeetingForetellTwo_viewnum = @"viewnum";
NSString *const kMeetingForetellTwo_supportnum = @"supportnum";
NSString *const kMeetingForetellTwo_head_img = @"head_img";
NSString *const kMeetingForetellTwo_nickname = @"nickname";
NSString *const kMeetingForetellTwo_imgsrc = @"imgsrc";
NSString *const kMeetingForetellTwo_follow = @"follow";
NSString *const kMeetingForetellTwo_position = @"position";

@implementation MeetingForetellFromModel_Two

@synthesize meetingid = _meetingid;
@synthesize title = _title;
@synthesize info = _info;
@synthesize industryid = _industryid;
@synthesize userid = _userid;
@synthesize create_date = _create_date;
@synthesize start_date = _start_date;
@synthesize viewnum = _viewnum;
@synthesize supportnum = _supportnum;
@synthesize head_img = _head_img;
@synthesize nickname = _nickname;
@synthesize imgsrc = _imgsrc;
@synthesize follow = _follow;
@synthesize position = _position;

+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
    return [[self alloc] initWithDictionary:dict];
}

// 初始化
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
    self = [super init];
    if (self && [dict isKindOfClass:[NSDictionary class]])
    {
        _title       = [self checkNilObjectForKey:kMeetingForetellTwo_title          fromDictionary:dict];
        _meetingid   = [self checkNilObjectForKey:kMeetingForetellTwo_meetingid      fromDictionary:dict];
        _info        = [self checkNilObjectForKey:kMeetingForetellTwo_info           fromDictionary:dict];
        _industryid  = [self checkNilObjectForKey:kMeetingForetellTwo_industryid     fromDictionary:dict];
        _userid      = [self checkNilObjectForKey:kMeetingForetellTwo_userid         fromDictionary:dict];
        _create_date = [self checkNilObjectForKey:kMeetingForetellTwo_create_date    fromDictionary:dict];
        _start_date  = [self checkNilObjectForKey:kMeetingForetellTwo_start_date     fromDictionary:dict];
        _viewnum     = [self checkNilObjectForKey:kMeetingForetellTwo_viewnum        fromDictionary:dict];
        _supportnum  = [self checkNilObjectForKey:kMeetingForetellTwo_supportnum     fromDictionary:dict];
        _head_img    = [self checkNilObjectForKey:kMeetingForetellTwo_head_img       fromDictionary:dict];
        _nickname    = [self checkNilObjectForKey:kMeetingForetellTwo_nickname       fromDictionary:dict];
        _imgsrc      = [self checkNilObjectForKey:kMeetingForetellTwo_imgsrc         fromDictionary:dict];
        _follow      = [self checkNilObjectForKey:kMeetingForetellTwo_follow         fromDictionary:dict];
        _position    = [self checkNilObjectForKey:kMeetingForetellTwo_position       fromDictionary:dict];
    }
    return self;
}

- (NSDictionary *)dictionaryRepresentation
{
    NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
    [mutableDict setValue:_meetingid         forKey:kMeetingForetellTwo_meetingid];
    [mutableDict setValue:_title             forKey:kMeetingForetellTwo_title];
    [mutableDict setValue:_info              forKey:kMeetingForetellTwo_info];
    [mutableDict setValue:_industryid        forKey:kMeetingForetellTwo_industryid];
    [mutableDict setValue:_userid            forKey:kMeetingForetellTwo_userid];
    [mutableDict setValue:_create_date       forKey:kMeetingForetellTwo_create_date];
    [mutableDict setValue:_start_date        forKey:kMeetingForetellTwo_start_date];
    [mutableDict setValue:_viewnum           forKey:kMeetingForetellTwo_viewnum];
    [mutableDict setValue:_supportnum        forKey:kMeetingForetellTwo_supportnum];
    [mutableDict setValue:_head_img          forKey:kMeetingForetellTwo_head_img];
    [mutableDict setValue:_nickname          forKey:kMeetingForetellTwo_nickname];
    [mutableDict setValue:_imgsrc            forKey:kMeetingForetellTwo_imgsrc];
    [mutableDict setValue:_follow            forKey:kMeetingForetellTwo_follow];
    [mutableDict setValue:_position          forKey:kMeetingForetellTwo_position];
    
    return [NSDictionary dictionaryWithDictionary:mutableDict];
}

- (id)checkNilObjectForKey:(id)key fromDictionary:(NSDictionary *)dict
{
    id object = [dict objectForKey:key];
    return [object isKindOfClass:[NSNull class]] ? nil : object;
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"%@",[self dictionaryRepresentation]];
}


@end
